﻿@model SPagedList<Dyd.BaseService.ServiceCenter.Domain.Model.tb_protocolversion>
@{
    ViewBag.Title = "";
    Layout = "~/Views/Shared/_LayoutLayer.cshtml";
}
@Html.AntiForgeryToken()
<div class="main">
    @using (Ajax.BeginForm("ProtocolVersionIndex", "ProtocolVersion", null, new AjaxOptions { UpdateTargetId = "ajaxList", InsertionMode = InsertionMode.Replace }, new { id = "ajaxForm" }))
    {
        <input type="hidden" id="serviceid" name="serviceid" value="@ViewBag.ServiceId" />
    }
</div>

<div id="ajaxList" class="m10">
    @Html.Partial("_ProtocolVersionIndex", Model)
</div>

@section Scripts{
    <script src="~/Scripts/layer/layer.js"></script>
    <link href="~/Scripts/layer/skin/layer.css" rel="stylesheet" />
}

@section footerScripts{
    @Html.SPagerScript()
    <script>

        $(function () {

            $("#ajaxList").on("click", function (event) {
                var type = $(event.target).attr("class");
                switch (type) {
                    case "downDemo": showItem(event.target); break;
                }
            });
        });

        //下载
        function showItem(obj) {
            var id = $(obj).parent().parent().attr("data-id");
            var url = "/ProtocolVersion/ProtocolVersionDown/" + id;
            $.ajax({
                url: url,
                success: function (data) {
                    location.href = data.Url;
                },
            });

            window.location.href = url;
        }

    </script>
}